package com.cn.bopu.common.upms.user.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Description:用户登录日志表
 * @author 史绍波
 * @since 2020-01-09
 */
@ApiModel(value ="用户登录日志表")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user_log")
public class UserLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.UUID)
    private String id;
    @ApiModelProperty(value = "用户ID")
    @TableField("user_id")
    private String userId;
    @ApiModelProperty(value = "平台code")
    @TableField("platform_code")
    private String platformCode;
    @ApiModelProperty(value = "登录方式：1账号登录，2邮箱登录，3手机号登录，4微信登录")
    @TableField("login_type")
    private String loginType;
    @ApiModelProperty(value = "登入时间")
    @TableField("login_time")
    private LocalDateTime loginTime;
    @ApiModelProperty(value = "登出时间")
    @TableField("logout_time")
    private LocalDateTime logoutTime;
    @ApiModelProperty(value = "登录ip")
    @TableField("login_ip")
    private String loginIp;
    @ApiModelProperty(value = "登录地址")
    @TableField("login_address")
    private String loginAddress;
    @ApiModelProperty(value = "创建时间戳")
    @TableField("create_timestamp")
    private LocalDateTime createTimestamp;
    @ApiModelProperty(value = "更新时间戳")
    @TableField("update_timestamp")
    private LocalDateTime updateTimestamp;


    public static final String ID = "id";

    public static final String USER_ID = "user_id";

    public static final String PLATFORM_CODE = "platform_code";

    public static final String LOGIN_TYPE = "login_type";

    public static final String LOGIN_TIME = "login_time";

    public static final String LOGOUT_TIME = "logout_time";

    public static final String LOGIN_IP = "login_ip";

    public static final String LOGIN_ADDRESS = "login_address";

    public static final String CREATE_TIMESTAMP = "create_timestamp";

    public static final String UPDATE_TIMESTAMP = "update_timestamp";

}
